﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SinsenWeb.Models;

namespace SinsenWeb.Helpers
{
    public class SecurityHelper
    {

        public static bool HasRights(SecurityRole Role)
        {
            var member = LoginHelper.GetCurrentMember();
            return HasRights(member, Role);
        }

        public static bool HasRights(Member member, SecurityRole role)
        {
            return (member.SecurityRole & role.GetHashCode()) == role.GetHashCode();
        }
    }
}
